// packageG/mycomponent/component/waterfall/waterfall.js
const app = getApp();
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    datas: {
      type: null,
    },
    storeList: {
      type: null,
    },
    showMun: {
      type: null,
    },
    plugin_active: String,
    is_sales_display: {
      type: null,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    paddingArr:[10,10,10,10]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    toRouter(e){
      let item = e.currentTarget.dataset.item;
      if (item.specify_show == 1) {
        wx.navigateTo({
          url: "/packageC/o2o/o2oStore/o2oStore?store_id=" +
						item.id +
						"&fromHome=1",
        });
      } else {
        if (item.store_decorate == 1) {
          wx.navigateTo({
            url: "/packageG/o2o/HomeSeller/HomeSeller?store_id=" + item.id,
          });
        } else {
          wx.navigateTo({
            url: "/packageC/o2o/HomeSeller/HomeSeller?store_id=" + item.id,
          });
        }
      }
    },
    // 打开地图
    goToAdress(e) {
      console.log(e)
      let latitude = e.currentTarget.dataset.item.latitude;
      let longitude = e.currentTarget.dataset.item.longitude;
      let store_name = e.currentTarget.dataset.item.store_name;
      let point = app.BMapTransqqMap(
        parseFloat(longitude),
        parseFloat(latitude)
      );
      wx.openLocation({
        latitude: point.lat,
        longitude: point.lng,
        scale: 18,
        name: store_name,
      });
    },
  }
})